package com.sy.controller;

import com.sy.dto.JsonResult;
import com.sy.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

/**
 * Description:
 * date: 2021/1/15 14:43
 *
 * @author:
 * @since JDK 1.8
 */
@RestController
public class CategoryController {
    @Autowired
    private CategoryService categoryService;
    @Autowired(required = false)
    private HttpServletResponse res;

    @RequestMapping(value = "/categories",method = RequestMethod.GET)
    public JsonResult getCategoryNodes(){
        JsonResult result = categoryService.getAllCategoryNodes();
        res.setStatus(result.getCode());
        return result;
    }
}
